The function dcemri.info is used to find the ecode or
the XML namespace relevant to the audit trail. The function enableAuditTrail is called as the package loads to
switch on the audit trail functionality and declare the class
niftiAuditTrail. Should you wish to prevent the audit trail
functionality loading, you should set the option
NIfTI.audit.trail to FALSE. Manually calling the
function enableAuditTrail will override this setting and switch
on the functionality.
The function newAuditTrail returns an XMLAbstractNode
representing the root node of an audit trail. This is mostly intended
as an internal function.
The function niftiExtensionToAuditTrail takes an object
representing a NIfTI object, casts it as a niftiAuditTrail and
checks if there is an extension (a niftiExtensionSection) with
ecode equal to dcemri.info("ecode"); i.e. has a extension
with data representing a serialized audit trail. The function will
then strip the object of this extension parsing the serialized
edata into an audit trail and adding a read event to
the trail.
The function niftiAuditTrailToExtension takes a
niftiAuditTrail and returns a niftiExtensionSection with
edata containing the serialized form of the audit trail after
adding a saved event to the trail.
The function niftiAuditTrailSystemNodeEvent adds an element
with name equal to type to the trail. It uses the
niftiAuditTrailSystemNode function to create the node.
The function niftiAuditTrailSystemNode is an internal function
creating an XMLAbstractNode element with name type and
attributes giving information about the R system and library. The
filename and call will also be added as attributes if
available.
The function niftiAuditTrailEvent adds an element with name
event to the trail. The arguments type,
filename, call are added as attributes and the
comment is the text value of the element.
The function niftiAuditTrailCreated will create a new audit
trail containing a system node element created with the child
history with the contents history. If the last element
of the history given is an event with
type="processing", then this node will be removed from the
history and its call attribute will be used as the value
of the call attribute on the created node.
The function getLastCallWithName will search the call stack for
a call of the function functionName, returning last call to
that function if possible. It will default to the call of the
function which called the function which called getLastCallWithName if
there was no such call (and if there was no such call it will return
the call of itself).